home *** CD-ROM | disk | FTP | other *** search
Korn shell script | 1997-02-07 | 1.4 KB | 78 lines |
- #!/bin/ksh
- #
- # Simple script to fire up the PVM launcher
- #
-
- Launcher=/usr/array/PVM/lib/xpvm
- Usage="$0 <origin> <display> <array name> [<envvar> <value>]..."
-
- #
- # Make sure enough args were specified
- #
- if [ "$#" -lt 3 ]; then
- echo "Incorrect number of arguments to $0"
- echo $Usage
- exit 1
- fi
-
- #
- # Give command line args more meaningful names
- #
- Origin=$1
- DISPLAY=$2
- Array=$3
- shift 3
-
- #
- # Set some relevant environment variables that xwsh doesn't handle
- #
- eval HOME=~$LOGNAME
- export DISPLAY HOME
-
- #
- # Switch to /tmp, since xpvm likes to write to the CWD
- #
- cd /tmp
-
- #
- # Set any caller-specified environment variables
- #
- while [ $# -gt 1 ]; do
- VarName=$1
- VarValue=$2
-
- eval "export $VarName="'"'$VarValue'"'
-
- shift 2
- done
-
- #
- # If the launcher is not installed, quit now
- #
- if [ ! -x $Launcher ]; then
- /usr/bin/X11/xconfirm \
- -c \
- -header "Launch PVM Job" \
- -t "Sorry, the PVM job launcher $Launcher is not installed" \
- -icon error \
- > /dev/null
- exit 1
- fi
-
- #
- # Invoke the launcher from an xwsh so that console input & output are available
- # Unfortunately, at this time the launcher doesn't understand arrays, so we
- # just discard the value of $Array that was passed to us by the caller.
- #
- exec /usr/sbin/xwsh \
- -fn "-*-screen-medium-r-normal--12-*-*-*-m-70-iso8859-1" \
- -geometry 80x24 \
- -holdonerror \
- -iconic \
- -name XPVMCons \
- -title "XPVM console" \
- -ut \
- -e $Launcher
-
- exit 0
-